package com.cy.pj.students.service;

import com.cy.pj.students.dao.StudentsDao;
import com.cy.pj.students.pojo.Students;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentsImpl implements StudentsService{

    @Autowired
    private StudentsDao studentsDao;



    @Override
    public List<Students> findAll() {
        return studentsDao.findStudents();
    }

    @Override
    public int insert(Students students) {
        return studentsDao.doSaveStudents(students);
    }

    @Override
    public Students findById(Integer id) {
        return studentsDao.doFindById(id);
    }

    @Override
    public int updateStudents(Students students) {
        return studentsDao.doUpdateStudents(students);
    }

    @Override
    public int deleteStudents(Integer id) {
        return studentsDao.doDeleteById(id);
    }
}
